Micron Document
🌎 rns.kin.earth git 🌍

Node / dev / reticulum / commits / 4c69b37

Commit 4c69b376b2a7ef8cf5771ab62034428a7cf77a2a


Parents : 2b1b958
Author : Mark Qvist <bc7291552be7a58f361522990465165c>
Signature : T66BB85Valid, signed by author
Date : 2026-08-21T22:20:00+02:00

Added adaptive timeouts to utilities, by Zenith

Changes

4 files changed, 10 insertions(+), 7 deletions(-)


Diff

diff --git a/RNS/Utilities/rncp.py b/RNS/Utilities/rncp.py
index 3fa84e26..151a5723 100644
--- a/RNS/Utilities/rncp.py
+++ b/RNS/Utilities/rncp.py
@@ -401,7 +401,7 @@ def fetch(configdir, identitypath = None, verbosity = 0, quietness = 0, destinat
i = 0
syms = "⢄⢂⢁⡁⡈⡐⡠"
- estab_timeout = time.time()+timeout
+ estab_timeout = time.time()+max(timeout, reticulum.get_medium_path_timeout())
while not RNS.Transport.has_path(destination_hash) and time.time() < estab_timeout:
if not silent:
time.sleep(0.1)
@@ -431,6 +431,7 @@ def fetch(configdir, identitypath = None, verbosity = 0, quietness = 0, destinat
)
link = RNS.Link(listener_destination)
+ estab_timeout = max(estab_timeout, time.time()+link.establishment_timeout)
while link.status != RNS.Link.ACTIVE and time.time() < estab_timeout:
if not silent:
time.sleep(0.1)
@@ -656,7 +657,7 @@ def send(configdir, identitypath = None, verbosity = 0, quietness = 0, destinati
i = 0
syms = "⢄⢂⢁⡁⡈⡐⡠"
- estab_timeout = time.time()+timeout
+ estab_timeout = time.time()+max(timeout, reticulum.get_medium_path_timeout())
while not RNS.Transport.has_path(destination_hash) and time.time() < estab_timeout:
if not silent:
time.sleep(0.1)
@@ -686,6 +687,7 @@ def send(configdir, identitypath = None, verbosity = 0, quietness = 0, destinati
)
link = RNS.Link(receiver_destination)
+ estab_timeout = max(estab_timeout, time.time()+link.establishment_timeout)
while link.status != RNS.Link.ACTIVE and time.time() < estab_timeout:
if not silent:
time.sleep(0.1)

diff --git a/RNS/Utilities/rnpath.py b/RNS/Utilities/rnpath.py
index 5b0a30db..3f65a691 100644
--- a/RNS/Utilities/rnpath.py
+++ b/RNS/Utilities/rnpath.py
@@ -42,6 +42,7 @@ remote_link = None
output_rst_str = "\r \r"
def connect_remote(destination_hash, auth_identity, timeout, no_output = False, purpose="management"):
global remote_link, reticulum
+ timeout = max(timeout, reticulum.get_medium_path_timeout())
if not RNS.Transport.has_path(destination_hash):
if not no_output:
print("Path to "+RNS.prettyhexrep(destination_hash)+" requested", end=" ")
@@ -451,7 +452,7 @@ def program_setup(configdir, table, rates, drop, destination_hexhash, verbosity,
i = 0
syms = "⢄⢂⢁⡁⡈⡐⡠"
- limit = time.time()+timeout
+ limit = time.time()+max(timeout, reticulum.get_medium_path_timeout())
while not RNS.Transport.has_path(destination_hash) and time.time()<limit:
time.sleep(0.1)
print(("\b\b"+syms[i]+" "), end="")

diff --git a/RNS/Utilities/rnprobe.py b/RNS/Utilities/rnprobe.py
index aecff372..40603805 100644
--- a/RNS/Utilities/rnprobe.py
+++ b/RNS/Utilities/rnprobe.py
@@ -81,7 +81,7 @@ def program_setup(configdir, destination_hexhash, size=None, full_name = None, v
print("Path to "+RNS.prettyhexrep(destination_hash)+" requested ", end=" ")
sys.stdout.flush()
- _timeout = time.time() + (timeout or DEFAULT_TIMEOUT+reticulum.get_first_hop_timeout(destination_hash))
+ _timeout = time.time() + (timeout or max(DEFAULT_TIMEOUT+reticulum.get_first_hop_timeout(destination_hash), reticulum.get_medium_path_timeout()))
i = 0
syms = "⢄⢂⢁⡁⡈⡐⡠"
while not RNS.Transport.has_path(destination_hash) and not time.time() > _timeout:
@@ -131,7 +131,7 @@ def program_setup(configdir, destination_hexhash, size=None, full_name = None, v
print("\rSent probe "+str(sent)+" ("+str(size)+" bytes) to "+RNS.prettyhexrep(destination_hash)+more+" ", end=" ")
- _timeout = time.time() + (timeout or DEFAULT_TIMEOUT+reticulum.get_first_hop_timeout(destination_hash))
+ _timeout = time.time() + (timeout or max(DEFAULT_TIMEOUT+reticulum.get_first_hop_timeout(destination_hash), reticulum.get_medium_path_timeout()))
i = 0
while receipt.status == RNS.PacketReceipt.SENT and not time.time() > _timeout:
time.sleep(0.1)

diff --git a/RNS/Utilities/rnx.py b/RNS/Utilities/rnx.py
index 0be8219b..4bfcf83b 100644
--- a/RNS/Utilities/rnx.py
+++ b/RNS/Utilities/rnx.py
@@ -347,7 +347,7 @@ def execute(configdir, identitypath = None, verbosity = 0, quietness = 0, detail
if not RNS.Transport.has_path(destination_hash):
RNS.Transport.request_path(destination_hash)
- if not spin(until=lambda: RNS.Transport.has_path(destination_hash), msg="Path to "+RNS.prettyhexrep(destination_hash)+" requested", timeout=timeout):
+ if not spin(until=lambda: RNS.Transport.has_path(destination_hash), msg="Path to "+RNS.prettyhexrep(destination_hash)+" requested", timeout=max(timeout, reticulum.get_medium_path_timeout())):
print("Path not found")
exit(242)
@@ -365,7 +365,7 @@ def execute(configdir, identitypath = None, verbosity = 0, quietness = 0, detail
link = RNS.Link(listener_destination)
link.did_identify = False
- if not spin(until=lambda: link.status == RNS.Link.ACTIVE, msg="Establishing link with "+RNS.prettyhexrep(destination_hash), timeout=timeout):
+ if not spin(until=lambda: link.status == RNS.Link.ACTIVE, msg="Establishing link with "+RNS.prettyhexrep(destination_hash), timeout=max(timeout, link.establishment_timeout)):
print("Could not establish link with "+RNS.prettyhexrep(destination_hash))
exit(243)

Served by rngit 1.5.2 - Generated in 0.08s